﻿// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently

#pragma once

#ifndef STRICT
#define STRICT
#endif

// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER              // Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0400       // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif

#ifndef _WIN32_WINNT        // Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target Windows 2000 or later.
#endif                      

#ifndef _WIN32_WINDOWS      // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif

#ifndef _WIN32_IE           // Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0400    // Change this to the appropriate value to target IE 5.0 or later.
#endif

#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS  // some CString constructors will be explicit

// turns off ATL's hiding of some common and often safely ignored warning messages
#define _ATL_ALL_WARNINGS


#include "resource.h"
#include <atlbase.h>
#include <atlcom.h>
#include <atlhost.h>
#include <atlstr.h>
#include <vector>


#pragma warning( disable : 4278 )
#pragma warning( disable : 4146 )
    //The following #import imports the IDTExtensibility2 interface
    #import <MSADDNDR.DLL> raw_interfaces_only named_guids

    //The following #import imports VS Command Bars
    #import <vsmso.olb> raw_interfaces_only named_guids

    //The following #import imports DTE
    #import <dte80a.olb> raw_interfaces_only named_guids exclude("ULONG_PTR", "LONG_PTR")

    //The following #import imports DTE80
    #import <dte80.olb> raw_interfaces_only named_guids

    //The following #import imports DTE90
    #import <dte90.olb> raw_interfaces_only named_guids

    //The following #import imports DTE90a
    #import <dte90a.olb> raw_interfaces_only named_guids

    //The following #import imports DTE100
    #import <dte100.olb> raw_interfaces_only named_guids
#pragma warning( default : 4146 )
#pragma warning( default : 4278 )

#include <vsshell.h>
#include <vsshelluuids.h>

class DECLSPEC_UUID("0426C75C-2553-4FE3-9545-B4471E113C44") XortAddinLib;

extern const GUID __declspec(selectany) 
    IID_IVsDebugger = { 0x7d960b16, 0x7af8, 0x11d0, { 0x8e, 0x5e, 0x00, 0xa0, 0xc9, 0x11, 0x00, 0x5a } };

extern const GUID __declspec(selectany)
    IID_IVsUIShell = { 0xB61FC35B, 0xEEBF, 0x4dec, { 0xBF, 0xF1, 0x28, 0xA2, 0xDD, 0x43, 0xC3, 0x8F } };

extern const GUID __declspec(selectany) 
    IID_IXortDebugEngine = { 0x662B1DC6, 0xAB6D, 0x4AE5, { 0xA5, 0x18, 0x23, 0xF0, 0xC6, 0x1F, 0xC5, 0x0A } };

using namespace ATL;

class CAddInModule : public CAtlDllModuleT< CAddInModule >
{
public:
    CAddInModule()
    {
        m_hInstance = NULL;
    }

    DECLARE_LIBID(__uuidof(XortAddinLib))

    inline HINSTANCE GetResourceInstance()
    {
        return m_hInstance;
    }

    inline void SetResourceInstance(HINSTANCE hInstance)
    {
        m_hInstance = hInstance;
    }

private:
    HINSTANCE m_hInstance;
};

extern CAddInModule _AtlModule;